.markdown-viewer {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  line-height: 1.7;
  color: #333;

  // 标题样式
  :global {
    h1 {
      font-size: 32px;
      font-weight: 600;
      margin: 24px 0 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid #eaecef;
      line-height: 1.25;
    }

    h2 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0 16px;
      padding-bottom: 8px;
      border-bottom: 1px solid #eaecef;
      line-height: 1.25;
    }

    h3 {
      font-size: 20px;
      font-weight: 600;
      margin: 24px 0 16px;
      line-height: 1.25;
    }

    h4 {
      font-size: 16px;
      font-weight: 600;
      margin: 24px 0 16px;
      line-height: 1.25;
    }

    h5 {
      font-size: 14px;
      font-weight: 600;
      margin: 24px 0 16px;
      line-height: 1.25;
    }

    h6 {
      font-size: 13px;
      font-weight: 600;
      margin: 24px 0 16px;
      line-height: 1.25;
      color: #6a737d;
    }

    // 段落
    p {
      margin: 0 0 16px;
      line-height: 1.7;
    }

    // 链接
    a {
      color: #0366d6;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }

    // 列表
    ul,
    ol {
      padding-left: 2em;
      margin: 0 0 16px;
    }

    li {
      margin: 4px 0;

      > p {
        margin-bottom: 8px;
      }
    }

    // 代码块
    pre {
      background: #f6f8fa;
      border-radius: 6px;
      padding: 16px;
      overflow: auto;
      margin: 0 0 16px;
      font-size: 85%;
      line-height: 1.45;

      code {
        background: transparent;
        padding: 0;
        border: none;
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
      }
    }

    // 行内代码
    code {
      background: rgba(175, 184, 193, 0.2);
      padding: 0.2em 0.4em;
      margin: 0;
      font-size: 85%;
      border-radius: 6px;
      font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    }

    // 引用块
    blockquote {
      padding: 0 1em;
      color: #6a737d;
      border-left: 0.25em solid #dfe2e5;
      margin: 0 0 16px;

      > :first-child {
        margin-top: 0;
      }

      > :last-child {
        margin-bottom: 0;
      }
    }

    // 水平线
    hr {
      height: 0.25em;
      padding: 0;
      margin: 24px 0;
      background-color: #e1e4e8;
      border: 0;
    }

    // 表格
    table {
      border-spacing: 0;
      border-collapse: collapse;
      margin: 0 0 16px;
      width: 100%;
      overflow: auto;

      th,
      td {
        padding: 6px 13px;
        border: 1px solid #dfe2e5;
      }

      th {
        font-weight: 600;
        background: #f6f8fa;
      }

      tr {
        background-color: #fff;
        border-top: 1px solid #c6cbd1;

        &:nth-child(2n) {
          background-color: #f6f8fa;
        }
      }
    }

    // 图片
    img {
      max-width: 100%;
      box-sizing: content-box;
      background-color: #fff;
      border-radius: 6px;
      margin: 16px 0;
    }

    // 任务列表
    input[type='checkbox'] {
      margin-right: 8px;
    }

    // 删除线
    del {
      text-decoration: line-through;
    }
  }
}
